/* ===============================================
   模型统计信息样式
   Model Statistics Styles
   =============================================== */

/* 统计信息容器 */
.manage-item-stats {
    margin: 8px 0;
    padding: 0;
}

/* 加载状态 */
.stats-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 0.3; }
}

/* 错误状态 */
.stats-error {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    font-size: 12px;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(255, 107, 107, 0.2);
}

.stats-error-icon {
    font-size: 14px;
}

.stats-error-text {
    flex: 1;
}

/* 统计摘要 */
.stats-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-summary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.stats-summary-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.stats-icon {
    font-size: 14px;
    opacity: 0.8;
}

.stats-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    font-weight: 500;
}

.stats-toggle {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    transition: transform 0.2s ease;
    margin-left: 8px;
}

.stats-summary:hover .stats-toggle {
    color: rgba(255, 255, 255, 0.7);
}

/* 统计详情 */
.stats-details {
    margin-top: 8px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 统计网格 */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.stats-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.stats-item-full {
    grid-column: 1 / -1;
}

.stats-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
}

.stats-value {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* 高亮数值 */
.stats-value:contains('K') {
    color: #4ecdc4;
}

.stats-value:contains('M') {
    color: #45b7d1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-item {
        padding: 6px 10px;
    }
    
    .stats-summary {
        padding: 10px 12px;
    }
    
    .stats-text {
        font-size: 11px;
    }
}

/* 小屏幕优化 */
@media (max-width: 480px) {
    .stats-summary-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .stats-text {
        font-size: 10px;
        line-height: 1.3;
    }
    
    .stats-details {
        padding: 8px;
    }
    
    .stats-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .stats-label {
        font-size: 10px;
    }
    
    .stats-value {
        font-size: 10px;
    }
}

/* 深色主题适配 */
@media (prefers-color-scheme: light) {
    .stats-summary {
        background: rgba(0, 0, 0, 0.05);
        border-color: rgba(0, 0, 0, 0.1);
    }
    
    .stats-summary:hover {
        background: rgba(0, 0, 0, 0.08);
        border-color: rgba(0, 0, 0, 0.15);
    }
    
    .stats-text {
        color: rgba(0, 0, 0, 0.8);
    }
    
    .stats-toggle {
        color: rgba(0, 0, 0, 0.5);
    }
    
    .stats-details {
        background: rgba(255, 255, 255, 0.8);
        border-color: rgba(0, 0, 0, 0.1);
    }
    
    .stats-item {
        background: rgba(0, 0, 0, 0.03);
    }
    
    .stats-label {
        color: rgba(0, 0, 0, 0.6);
    }
    
    .stats-value {
        color: rgba(0, 0, 0, 0.8);
    }
}

/* 动画效果 */
.stats-summary .stats-toggle {
    transition: transform 0.2s ease;
}

.stats-summary[aria-expanded="true"] .stats-toggle {
    transform: rotate(180deg);
}

/* 加载动画优化 */
.stats-loading::before {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 4px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 统计数值特殊颜色 */
.stats-value {
    position: relative;
}

/* 大数值高亮 */
.stats-item:has(.stats-label:contains("顶点数")) .stats-value,
.stats-item:has(.stats-label:contains("三角形")) .stats-value {
    color: #4ecdc4;
}

/* 材质和节点数高亮 */
.stats-item:has(.stats-label:contains("材质数")) .stats-value,
.stats-item:has(.stats-label:contains("节点数")) .stats-value {
    color: #ffa726;
}

/* 深度和网格数高亮 */
.stats-item:has(.stats-label:contains("最大深度")) .stats-value,
.stats-item:has(.stats-label:contains("网格数")) .stats-value {
    color: #ab47bc;
}

/* 悬浮提示效果 */
.stats-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* 统计图标动画 */
.stats-icon {
    animation: statsIconPulse 2s ease-in-out infinite;
}

@keyframes statsIconPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.8;
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
    }
}

/* ===============================================
   模型结构详情弹窗样式
   =============================================== */

.structure-info {
    padding: 0;
}

.structure-section {
    margin-bottom: 24px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.structure-section:last-child {
    margin-bottom: 0;
}

.structure-section h4 {
    margin: 0 0 12px 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.structure-section h4::before {
    content: '';
    width: 3px;
    height: 16px;
    background: linear-gradient(45deg, #4ecdc4, #45b7d1);
    border-radius: 2px;
}

/* 包围盒信息 */
.bounding-box-info {
    display: grid;
    gap: 8px;
}

.bbox-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.bbox-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.bbox-value {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.9);
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

/* 类型分布 */
.type-distribution {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 8px;
}

.type-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.type-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.type-name {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.type-count {
    font-size: 11px;
    color: #4ecdc4;
    font-weight: 700;
    background: rgba(78, 205, 196, 0.2);
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

/* 文件信息 */
.file-info {
    display: grid;
    gap: 8px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.file-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
}

.file-value {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
}

/* 大数值特殊样式 */
.stats-value:contains('K') {
    background: linear-gradient(45deg, #4ecdc4, rgba(78, 205, 196, 0.3));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stats-value:contains('M') {
    background: linear-gradient(45deg, #45b7d1, rgba(69, 183, 209, 0.3));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 响应式优化 */
@media (max-width: 600px) {
    .type-distribution {
        grid-template-columns: 1fr;
    }
    
    .structure-section {
        padding: 12px;
    }
    
    .structure-section h4 {
        font-size: 13px;
    }
    
    .bbox-item, .type-item, .file-item {
        padding: 6px 10px;
    }
    
    .bbox-label, .type-name, .file-label {
        font-size: 11px;
    }
    
    .bbox-value, .type-count, .file-value {
        font-size: 10px;
    }
}

/* 加载动画增强 */
.structure-section .loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
}

.structure-section .loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top: 2px solid #4ecdc4;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* 深色主题适配（结构弹窗） */
@media (prefers-color-scheme: light) {
    .structure-section {
        background: rgba(0, 0, 0, 0.03);
        border-color: rgba(0, 0, 0, 0.1);
    }
    
    .structure-section h4 {
        color: rgba(0, 0, 0, 0.8);
    }
    
    .bbox-item, .type-item, .file-item {
        background: rgba(0, 0, 0, 0.03);
    }
    
    .bbox-label, .type-name, .file-label {
        color: rgba(0, 0, 0, 0.7);
    }
    
    .bbox-value, .file-value {
        color: rgba(0, 0, 0, 0.9);
    }
    
    .type-name {
        color: rgba(0, 0, 0, 0.8);
    }
}
